<?php
class ORMUser extends ORMBase {
  public function __construct() {
    parent::__construct('User');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    require_once dirname(__FILE__) . '/ORMUserSkill.class.php';
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->account = isset($object->account) ? $object->account : '';
    $epObject->password = isset($object->password) ? $object->password : '';
    $epObject->name = isset($object->name) ? $object->name : '';
    $epObject->email = isset($object->email) ? $object->email : '';
    $epObject->type = isset($object->type) ? $object->type : '';
    if (isset($object->skill) && $object->skill) {
        $epObject->skill = $this->__getEpObject_4_lvl_1_object($myManager, $object->skill, new ORMUserSkill(), 'UserSkill');
    } else {
      if (isset($epObject->skill)) {
        $myManager->delete($epObject->skill);
      }
    }
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    require_once dirname(__FILE__) . '/ORMUserSkill.class.php';
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->account = $epObject->account;
    $object->password = $epObject->password;
    $object->name = $epObject->name;
    $object->email = $epObject->email;
    $object->type = $epObject->type;
    if (isset($epObject->skill)) {
      $object->skill = $this->__getObject_4_lvl_1_ep_object($myManager, $epObject->skill, new ORMUserSkill());
    }
    return $object;
  }
}
?>
